"use strict";

define(["angular", "app", "../services/socket"], function (angular, app) {
    app.factory("User", function ($q, socket) {
        var User = function (obj) {
            angular.extend(this, obj);
        };
        User.getAll = function () {
            var deferred = $q.defer();
            socket.emit("getAll", {});
            socket.on("getAll", function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        };
        return User;
    });
});